home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Slider
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Slider Demo"
- ClientHeight = 3720
- ClientLeft = 2580
- ClientTop = 2625
- ClientWidth = 4920
- ControlBox = 0 'False
- Height = 4125
- Icon = SLIDER.FRX:0000
- Left = 2520
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3720
- ScaleWidth = 4920
- Top = 2280
- Width = 5040
- Begin HScrollBar HScroll1
- Height = 285
- LargeChange = 60
- Left = 1860
- Max = 3210
- Min = 2010
- SmallChange = 60
- TabIndex = 4
- Top = 1710
- Value = 2010
- Width = 1515
- End
- Begin CommandButton Command1
- Caption = "E&xit"
- Default = -1 'True
- Height = 405
- Left = 3780
- TabIndex = 5
- Top = 3180
- Width = 1005
- End
- Begin Timer Timer2
- Left = 870
- Top = 4650
- End
- Begin PictureBox Picture2
- AutoSize = -1 'True
- Height = 675
- Left = 1470
- Picture = SLIDER.FRX:0302
- ScaleHeight = 645
- ScaleWidth = 2340
- TabIndex = 1
- Top = 2130
- Width = 2370
- Begin Image Image2
- Height = 615
- Left = 30
- Picture = SLIDER.FRX:2170
- Top = 0
- Width = 285
- End
- End
- Begin Timer Timer1
- Left = 330
- Top = 4620
- End
- Begin PictureBox Picture1
- AutoSize = -1 'True
- Height = 2370
- Left = 150
- Picture = SLIDER.FRX:28DE
- ScaleHeight = 2340
- ScaleWidth = 645
- TabIndex = 0
- Top = 390
- Width = 675
- Begin Image Image1
- Height = 285
- Left = 30
- Picture = SLIDER.FRX:4438
- Top = 30
- Width = 615
- End
- End
- Begin Line Line1
- X1 = 2010
- X2 = 2010
- Y1 = 1110
- Y2 = 1530
- End
- Begin Image Image3
- Height = 765
- Left = 1860
- Picture = SLIDER.FRX:4806
- Top = 930
- Width = 1515
- End
- Begin Label Label2
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- Caption = "Slider Demo"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 22.5
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FF0000&
- Height = 525
- Left = 1530
- TabIndex = 3
- Top = 240
- Width = 2505
- End
- Begin Label Label1
- BackStyle = 0 'Transparent
- Caption = "Slider Demo"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Times New Roman"
- FontSize = 22.5
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00808080&
- Height = 525
- Left = 1470
- TabIndex = 2
- Top = 210
- Width = 2505
- End
- Dim Mouse_Button As Integer
- Dim Mouse_Y As Single
- Dim PicFrame As Integer
- Dim PicFrame1 As Integer
- Dim Mouse_X As Single
- Sub Command1_Click ()
- Unload Me
- End Sub
- Sub Form_Load ()
- '// Center Form
- Top = Screen.Height / 2 - Height / 2
- Left = Screen.Width / 2 - Width / 2
- '// Set Vert. Slide Bar
- Timer1.Enabled = False
- Timer1.Interval = 10
- PicFrame = 2 * Screen.TwipsPerPixelY
- Image1.Top = 0
- Image1.Left = 0
- Picture1.Width = Image1.Width + PicFrame
- '// Set Horz. Slide Bar
- Timer2.Enabled = False
- Timer2.Interval = 10
- PicFrame1 = 2 * Screen.TwipsPerPixelY
- Image2.Top = 0
- Image2.Left = 0
- Picture2.Height = Image2.Height + PicFrame1
- End Sub
- Sub HScroll1_Change ()
- Line1.X1 = HScroll1.Value
- Line1.X2 = HScroll1.Value
- End Sub
- Sub Image1_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- Timer1.Enabled = True
- Mouse_Button = Button
- Mouse_Y = Image1.Top + Y
- End Sub
- Sub Image1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- Mouse_Button = Button
- Mouse_Y = Image1.Top + Y
- End Sub
- Sub Image1_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
- Timer1.Enabled = False
- Mouse_Button = Button
- Mouse_Y = Image1.Top + Y
- End Sub
- Sub Image2_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- Timer2.Enabled = True
- Mouse_Button = Button
- Mouse_X = Image2.Left + X
- End Sub
- Sub Image2_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- Mouse_Button = Button
- Mouse_X = Image2.Left + X
- End Sub
- Sub Image2_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
- Timer2.Enabled = False
- Mouse_Button = Button
- Mouse_X = Image2.Left + X
- End Sub
- Sub Timer1_Timer ()
- Dim TempTop As Integer
- If Mouse_Button = 1 Then
-
- TempTop = Image1.Top
- TempTop = Mouse_Y - TempWidth / 2
- If TempTop + Image1.Height > Picture1.Height Then
- TempTop = Picture1.Height - Image1.Height - PicFrame
- End If
- If TempTop < 0 Then TempTop = 0
- End If
- If Image1.Top <> TempTop Then Image1.Top = TempTop
- End Sub
- Sub Timer2_Timer ()
- Dim TempLeft As Integer
- If Mouse_Button = 1 Then
- TempLeft = Image2.Left
- TempLeft = Mouse_X - TempWidth / 2
- If TempLeft + Image2.Width > Picture2.Width Then
- TempLeft = Picture2.Width - Image2.Width - PicFrame
- End If
- If TempLeft < 0 Then TempLeft = 0
- End If
- If Image2.Left <> TempLeft Then Image2.Left = TempLeft
- End Sub
-